package com.ruoyi.web.controller.shopping;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.system.domain.shopping.Area;
import com.ruoyi.system.service.shopping.AreaService;
import com.ruoyi.system.view.common.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/xiaomi/v2/")
public class AreaController {

    @Autowired
    private AreaService areaService;

    @GetMapping("/area/{pid}")
    public Result<List<Area>> list(@PathVariable Integer pid){
        List<Area> areas = areaService.selectAreaByPid(pid);
        return Result.success(areas,"查询成功");
    }
}
